package com.windfone.service.impl;

import java.util.List;

import com.windfone.common.FileTool;
import com.windfone.dao.FittingDao;
import com.windfone.model.Fitting;
import com.windfone.model.Fittingtype;
import com.windfone.model.Fittingtypebase;
import com.windfone.service.FittingService;

public class FittingServiceImpl implements FittingService {
	private FittingDao fittingDao;
	public FittingDao getFittingDao() {
		return fittingDao;
	}

	public void setFittingDao(FittingDao fittingDao) {
		this.fittingDao = fittingDao;
	}

	public int deleteFitting(int keyValue) {
		Fitting bean = fittingDao.getFittingById(keyValue).get(0);
		String suffix = bean.getImagepath();
		FileTool.dealPic(suffix );
		return fittingDao.deleteFitting(keyValue);
	}

	public int getAllRecorderNumber(String whereCondition) {
		return fittingDao.getAllRecorderNumber(whereCondition);
	}

	public int updateFitting(Fitting bean) {
		return fittingDao.updateFitting(bean);
	}

	public int insertFitting(Fitting bean) {
		return fittingDao.insertFitting(bean);
	}

	public List<Fitting> getFittingById(int keyValue) {
		return fittingDao.getFittingById(keyValue);
	}

	public List<Fitting> getAllFitting(int beginRecord,String whereCondition) {
		return fittingDao.getAllFitting(beginRecord,whereCondition);
	}
	public List<Fitting> getAllFittingNolimit( String whereCondition) {
		return fittingDao.getAllFittingNolimit(whereCondition);
	}

	public int getAllTypeRecorderNumber() {
		return fittingDao.getAllTypeRecorderNumber();
	}

	public List<Fittingtype> getAllFittingType(int beginRecord) {
		return fittingDao.getAllFittingType(beginRecord);
	}

	public List<Fittingtype> getFittingTypeById(int keyValue) {
		return fittingDao.getFittingTypeById(keyValue);
	}

	public int deleteFittingType(int fittingTypeId) {
		return fittingDao.deleteFittingType(fittingTypeId);
	}

	public int insertFittingType(Fittingtype fittype) {
		return fittingDao.insertFittingType(fittype);
	}

	public int updateFittingType(Fittingtype fittype) {
		return fittingDao.updateFittingType(fittype);
	}

	public List<Fittingtypebase> getAllFittingtypebase() {
		return fittingDao.getAllFittingtypebase();
	}

	public List<Fittingtype> getAllFittingType() {
		return fittingDao.getAllFittingType();
	}

	public List<Fittingtype> getFittingTypeByBaseId(int fittingtypebaseId) {
		return fittingDao.getFittingTypeByBaseId( fittingtypebaseId );
	}

	public List<Fitting> getCommendFittigByCommendType(String commendType) {
		return fittingDao.getCommendFittigByCommendType( commendType );
	}

	public List<Fitting> getFittingByTypeId(int fittingTypeId) {
		return fittingDao.getFittingByTypeId(fittingTypeId);
	}

	public List<Fittingtype> getFittingTypeByBaseTypeId(int baseTypeId) {
		return fittingDao.getFittingTypeByBaseTypeId(baseTypeId);
	}

}
